package dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import bean.Tile;
import dao.TileDao;
import exception.DBException;

public class TileDaoImpl extends HibernateDaoSupport implements TileDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<Tile> selectAll() throws DBException {
		return this.getHibernateTemplate().find("from Tile");
	}

	@Override
	public boolean save(List<Tile> tiles) throws DBException {
		for (Tile tile : tiles) {
			this.getHibernateTemplate().save(tile);
		}
		return true;
	}
}
